<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<#include "../common/header.ftl"/>
<script type="text/javascript" src="/js/plugins/jquery.form.js"></script>
<script type="text/javascript" src="/js/plugins/jquery.twbsPagination.min.js"></script>
<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js" ></script>

<script type="text/javascript">
	$(function(){
		$("#query").click(function(){
			$("#currentPage").val(1);
			$("#searchForm").submit();
		});
		
		$("#pagination_container").twbsPagination({
			totalPages:${pageResult.totalPage}||1,
			visiblePages:5,
			startPage:${pageResult.currentPage},
			first:"首页",
			prev:"上一页",
			next:"下一页",
			last:"末页",
			onPageClick:function(event,page){
				$("#currentPage").val(page);
				$("#searchForm").submit();
			}
		});
	});
</script>
</head>
<body>
	<div class="container">
		<#include "../common/top.ftl"/>
		<div class="row">
			<div class="col-sm-3">
				<#--<#assign currentMenu="ipLog" />-->
				<#include "../common/menu.ftl" />
			</div>
			<div class="col-sm-9">
				<div class="page-header">
					<h3>订单查询</h3>
				</div>
				<form id="searchForm" class="form-inline" method="post" action="/order">
					<input type="hidden" id="currentPage" name="currentPage" value="1"/>
					<div class="form-group">
					    <label>订单状态</label>
					     <select class="form-control" name="orderState" id="orderState">
					    	<option value="-1">全部</option>
                             <option value='0'>未确定</option>
                             <option value='1'>已确认</option>
                             <option value='2'>已完成</option>
						 </select>
					    <script type="text/javascript">
					    	$("#orderState option[value=${qo.orderState}]").attr("selected",true);
					    </script>
					</div>
                    <div class="form-group">
                        <label>订单物流状态</label>
                        <select class="form-control" name="shoppingState" id="shoppingState">
                            <option value="-1">全部</option>
                            <option value='0'>未发货</option>
                            <option value='1'>已发货</option>
                            <option value='2'>已收货</option>
                        </select>
                        <script type="text/javascript">
                            $("#shoppingState option[value=${qo.shoppingState}]").attr("selected",true);
                        </script>
                    </div>
                    <div class="form-group">
                        <label>订单支付状态</label>
                        <select class="form-control" name="payState" id="payState">
                            <option value="-1">全部</option>
                            <option value='0'>未付款</option>
                            <option value='1'>已付款</option>
                        </select>
                        <script type="text/javascript">
                            $("#payState option[value=${qo.payState}]").attr("selected",true);
                        </script>
                    </div>

                    <div class="form-group">
                        <label>订单号</label>
                        <input class="form-control" type="text" name="orderSn" value='${(qo.orderSn)!""}'/>
                    </div>
					<div class="form-group">
						<label>收货人</label>
						<input class="form-control" type="text" name="name" value='${(qo.name)!""}'/>
					</div>
					<div class="form-group">
						<button id="query" type="button" class="btn btn-success"><i class="icon-search"></i>搜索</button>
					</div>
				</form>
				<div class="panel panel-default">
					<table class="table table-hover">
						<thead>
							<tr class="info">
								<th>订单号</th>
								<th>收货人</th>
                                <th>订单状态</th>
                                <th>订单物流状态</th>
                                <th>订单支付状态</th>
                                <th>订单总价</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody id="tbody">
						<#list pageResult.listData as result>
							<tr>
                            <td>${result.orderSn}</td>
                            <td>${result.consignee}</td>
                            <td>${result.orderStatusDisplay}</td>
                            <td>${result.shippingStatusDisplay}</td>
                            <td>${result.payStatusDisplay}</td>
                            <td>${result.orderAmount}</td>
                            <td>
                                <a class="btn btn-default" href="/orderDetail?id=${result.id}"  role="button">操作</a>
                            </td>
                        </tr>
							</#list>
						</tbody>
					</table>
					<div style="text-align: center;" id="pagination_container">
						
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>